package com.atguigu.controller;

import com.atguigu.result.Result;
import com.atguigu.service.OaProcessService;
import com.atguigu.vo.process.ProcessQueryVo;
import com.atguigu.vo.process.ProcessVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@Api(tags = "审批流管理")
@RestController
@RequestMapping("admin/process")
public class OaProcessController {
    @Autowired
    private OaProcessService oaProcessService;
    @PreAuthorize("hasAuthority('bnt.process.list')")
    @ApiOperation("获取分页列表")
    @PostMapping("/{page}/{limit}")
    public Result getPage(@PathVariable Integer page, @PathVariable Integer limit, @RequestBody ProcessQueryVo processQueryVo){
        IPage<ProcessVo> page1=new Page<>(page,limit);
        IPage<ProcessVo> pageModel= oaProcessService.selectPage(page1,processQueryVo);
        return Result.ok(pageModel);

    }
}
